# DP: Remove unneed '..' elements from symlinks in JAVA_HOME

--- a/src/libjava/Makefile.am.orig	2009-04-28 12:24:21.000000000 +0200
+++ b/src/libjava/Makefile.am	2009-05-16 12:32:53.000000000 +0200
@@ -580,7 +580,7 @@
 	$(mkinstalldirs) $(DESTDIR)$(SDK_INCLUDE_DIR)/$(OS)
 	relative() { \
 	  $(PERL) -e 'use File::Spec; \
-	    print File::Spec->abs2rel($$ARGV[0], $$ARGV[1])' $$1 $$2; \
+	    print File::Spec->abs2rel($$ARGV[0], $$ARGV[1])' $$1 $$2 | sed -r 's,(bin|lib)[^/]*/\.\./,,'; \
 	}; \
 	RELATIVE=$$(relative $(DESTDIR)$(bindir) $(DESTDIR)$(SDK_BIN_DIR)); \
 	ln -sf $$RELATIVE/`echo gij | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'` \
--- a/src/libjava/Makefile.in.orig	2009-05-12 10:51:35.000000000 +0200
+++ b/src/libjava/Makefile.in	2009-05-16 12:34:13.000000000 +0200
@@ -12433,7 +12433,7 @@
 @CREATE_JAVA_HOME_TRUE@	$(mkinstalldirs) $(DESTDIR)$(SDK_INCLUDE_DIR)/$(OS)
 @CREATE_JAVA_HOME_TRUE@	relative() { \
 @CREATE_JAVA_HOME_TRUE@	  $(PERL) -e 'use File::Spec; \
-@CREATE_JAVA_HOME_TRUE@	    print File::Spec->abs2rel($$ARGV[0], $$ARGV[1])' $$1 $$2; \
+@CREATE_JAVA_HOME_TRUE@	    print File::Spec->abs2rel($$ARGV[0], $$ARGV[1])' $$1 $$2 | sed -r 's,(bin|lib)[^/]*/\.\./,,'; \
 @CREATE_JAVA_HOME_TRUE@	}; \
 @CREATE_JAVA_HOME_TRUE@	RELATIVE=$$(relative $(DESTDIR)$(bindir) $(DESTDIR)$(SDK_BIN_DIR)); \
 @CREATE_JAVA_HOME_TRUE@	ln -sf $$RELATIVE/`echo gij | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'` \
